// ==========================================================================
// gin-sns auto gen code.
// date：2021-02-21 13:45:53 +0800 CST
// path: app/model/module/answer/answer_entity.go
// author：jon
// ==========================================================================

package answer

import (
	"time"
)

// 数据表映射结构体
type Entity struct {
	Id              int64     `json:"id" xorm:"not null pk autoincr comment('id') bigint(20) unsigned"`
	UserId          int64     `json:"user_id" xorm:"comment('用户id') bigint(20)"`
	QuestionId      int64     `json:"question_id" xorm:"comment('回答问题的id') bigint(20)"`
	Content         string    `json:"content" xorm:"comment('评论内容') text"`
	Weight          int64     `json:"weight" xorm:"comment('问题权重') double(11,0)"`
	CountLike       int64     `json:"count_like" xorm:"comment('赞同数量') bigint(20)"`
	CountUnlike     int64     `json:"count_unlike" xorm:"comment('反对数量') bigint(20)"`
	CountReward     int64     `json:"count_reward" xorm:"comment('打赏数量') bigint(20)"`
	CountFavor      int64     `json:"count_favor" xorm:"comment('收藏数量') bigint(20)"`
	CountShare      int64     `json:"count_share" xorm:"comment('分享数量') bigint(20)"`
	CountComment    int64     `json:"count_comment" xorm:"comment('评论数量') bigint(20)"`
	Status          int       `json:"status" xorm:"comment('0未审核 1正常状态 2审核未通过 3删除') tinyint(2)"`
	CreateTime      time.Time `json:"create_time" xorm:"comment('创建时间') datetime"`
	UpdateTime      time.Time `json:"update_time" xorm:"comment('更新时间') datetime"`
	LastCommentTime time.Time `json:"last_comment_time" xorm:"comment('最后评论时间') datetime"`
}

//新增页面请求参数
type AddReq struct {
	UserId       int64  `form:"userId" `
	QuestionId   int64  `form:"questionId" `
	Content      string `form:"content" `
	Weight       int64  `form:"weight" `
	CountLike    int64  `form:"countLike" `
	CountUnlike  int64  `form:"countUnlike" `
	CountReward  int64  `form:"countReward" `
	CountFavor   int64  `form:"countFavor" `
	CountShare   int64  `form:"countShare" `
	CountComment int64  `form:"countComment" `
	Status       int    `form:"status" binding:"required"`

	LastCommentTime time.Time `form:"lastCommentTime" `
}

//修改页面请求参数
type EditReq struct {
	Id              int64     `form:"id" binding:"required"`
	UserId          int64     `form:"userId" `
	QuestionId      int64     `form:"questionId" `
	Content         string    `form:"content" `
	Weight          int64     `form:"weight" `
	CountLike       int64     `form:"countLike" `
	CountUnlike     int64     `form:"countUnlike" `
	CountReward     int64     `form:"countReward" `
	CountFavor      int64     `form:"countFavor" `
	CountShare      int64     `form:"countShare" `
	CountComment    int64     `form:"countComment" `
	Status          int       `form:"status" binding:"required不能为空"`
	LastCommentTime time.Time `form:"lastCommentTime" `
}

//分页请求参数
type SelectPageReq struct {
	UserId          int64     `form:"userId"`          //用户id
	QuestionId      int64     `form:"questionId"`      //回答问题的id
	Content         string    `form:"content"`         //评论内容
	Weight          int64     `form:"weight"`          //问题权重
	CountLike       int64     `form:"countLike"`       //赞同数量
	CountUnlike     int64     `form:"countUnlike"`     //反对数量
	CountReward     int64     `form:"countReward"`     //打赏数量
	CountFavor      int64     `form:"countFavor"`      //收藏数量
	CountShare      int64     `form:"countShare"`      //分享数量
	CountComment    int64     `form:"countComment"`    //评论数量
	Status          int       `form:"status"`          //0未审核 1正常状态 2审核未通过 3删除
	LastCommentTime time.Time `form:"lastCommentTime"` //最后评论时间
	BeginTime       string    `form:"beginTime"`       //开始时间
	EndTime         string    `form:"endTime"`         //结束时间
	PageNum         int       `form:"pageNum"`         //当前页码
	PageSize        int       `form:"pageSize"`        //每页数
}
